//
//  JSModaContentView.h
//  JSBasicFramework
//
//  Created by Apple on 2019/9/3.
//  Copyright © 2019 Apple. All rights reserved.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN


typedef NS_ENUM(NSUInteger, JSModaContentPostion) {
    JSModaContentPostionLeft,
    JSModaContentPostionCenter,
    JSModaContentPostionRight,
};
@interface SGMModaItem : NSObject
/**
 * 内容对齐方式
 */
@property (nonatomic, assign) JSModaContentPostion itemPostion;
/**
 * 图片名称
*/
@property (nonatomic, strong) NSString *imageName;
/**
 * title
*/
@property (nonatomic, strong) NSString *title;
/**
 * titleColor
*/
@property (nonatomic, strong) UIColor *titleColor;

@property (nonatomic, copy) dispatch_block_t clickHandle;

- (instancetype)initWithTitle:(NSString *)title imageName:(NSString  * _Nullable )imageName itemPostion:(JSModaContentPostion)itemPostion clikeHandle:(dispatch_block_t)clickHandle;
- (instancetype)initWithTitle:(NSString *)title imageName:(NSString  * _Nullable )imageName titleColor:(UIColor *)titleColor itemPostion:(JSModaContentPostion)itemPostion clikeHandle:(dispatch_block_t)clickHandle;

@end
/**
 * 将这个类作为 QMUIModalPresentationViewController contenView 的父类
 * 主要作用是用过 JSUIHelper 执行 moda操作后 对 QMUIModalPresentationViewController 有个引用 方便contenView 内部主动 dismiss
 
 */
@interface JSModaContentView : UIView

@property (nonatomic, weak) QMUIModalPresentationViewController *modalViewController;
@property (nonatomic, strong, readonly) NSArray <SGMModaItem *> *items;
@property (nonatomic, assign) CGFloat itemContenHeight;

/**
 * 高度通过item的数量确定 每个item内容所在高度为50
 * @params frame 需要明确指定宽高
 */
- (instancetype)initWithFrame:(CGRect)frame items:(NSArray <SGMModaItem *>*) items;
- (void)updateContentItems:(NSArray <SGMModaItem *> *)items;

- (void)didInitIalizeSubView;
- (void)modaDismiss;
@end



@interface SGMModaBottomView : JSModaContentView

@property (nonatomic, copy) dispatch_block_t didSelectConfirm;

- (instancetype)initWithFrame:(CGRect)frame confirmTitle:(NSString *)confirmTitle compleiton:(dispatch_block_t)completion;

@end
NS_ASSUME_NONNULL_END
